package ar.com.fiuba.ElectronicCircuitAnalyst.infraestructure.db40.repository.testing;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit38.AbstractJUnit38SpringContextTests;

import com.db4o.ObjectContainer;

@ContextConfiguration(locations = {"classpath:ApplicationContextTest.xml"})
public class DataBaseTestSupport extends AbstractJUnit38SpringContextTests {
	
	@Autowired
	private ObjectContainer objectContainer;
	
	@Override
	protected void tearDown() throws Exception {
		this.objectContainer.rollback();
		super.tearDown();
	}
	
	/**
	 * @return the objectContainer
	 */
	public ObjectContainer getObjectContainer() {
		return objectContainer;
	}

	/**
	 * @param objectContainer the objectContainer to set
	 */
	public void setObjectContainer(ObjectContainer objectContainer) {
		this.objectContainer = objectContainer;
	}
	
}
